import rpA from 'request-promise';

class IndexModel {
  constructor(ctx) {
    this.ctx = ctx;
  }
  updateNum(params) {
    let options = {
      method: 'GET',
      uri: 'http://localhost:80/mythumb/app/mysql/thumbupOob.php',
      qs: params
    }
    return new Promise((resolve, reject) => {
      rpA(options).then((result) => {
        try {
          let info = JSON.parse(result);
          if (info.result) {
            resolve(info)
          } else {
            reject({});
          }

        } catch (e) {
          reject({
            resutlCode: 1,
            resultMsg: '获取结果失败'
          });
        }
      })
    })
  }
}
export {
  IndexModel
};